package com.oo.array_$.case_2;

import java.util.Scanner;

/**
 * MultDemo--编写JAVA程序，实现接收用户输入的5个数字，
 * 统计其中能被5整除的数据个数，并求和
 *
 * @author: Jovi
 * @createTime: 2017-05-11 17:41
 **/
public class MultDemo {

    public static void main(String[] args) {
        int[] a = new int[5];
        int count=0,sum = 0;

        Scanner sc = new Scanner(System.in);
        System.out.println("Enter 5 numbers：");
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
            if (a[i] % 5 == 0) {
                count++;
                sum += a[i];
            }
        }
        System.out.println("================");
        System.out.println("A total of receiving "+count +" multiples of 5,the sum of the data is "+sum);
    }
}
